<%@ page contentType='text/html; charset=iso-8859-1' language="java"%>
<%@ page pageEncoding="UTF-8"%>
<%@ include file="../WEB-INF/jspf/cabecalho.jspf" %>
<%@ include file="../WEB-INF/jspf/acesso.jspf" %>
<%@ include file="../WEB-INF/jspf/setMeta.jspf" %>

<sql:query var='rsetUsuario' dataSource='${con}'>    
    SELECT Usuario.usuario, Usuario.nome, Usuario.equipe FROM Usuario 
    WHERE Usuario.usuario='<%out.print( session.getValue("usuarioLogado"));%>'        
</sql:query>  

<sql:query var='rsetReg' dataSource='${con}'>    
    SELECT Solicitacao.idSolicitacao, Solicitacao.solicitante, Solicitacao.dataAbertura, Solicitacao.horaAbertura,
    Solicitacao.status, Solicitacao.equipe, Solicitacao.tecnico, Solicitacao.assunto, Solicitacao.percentual FROM Solicitacao
    WHERE Solicitacao.status<>'Arquivada' AND Solicitacao.tecnico='<c:out value="${rsetUsuario.rowsByIndex[0][1]}"/>'
    ORDER BY Solicitacao.idSolicitacao DESC
</sql:query>

<form name="form1" method="post" action="">
  <fieldset>
  <legend><font color="#0000FF"><strong>Solicita&ccedil;&otilde;es em Atendimento</strong></font></legend>
  <br/>
  <table width="30%" border="0">
     <tr bgcolor="#CCCCCC">
          <td width="10%"><div align="center"><strong><a href="visualizarSolicitacoesEmAtendimento.jsp" >Todas</a></strong></div></td>
          <td width="10%"><div align="center"><strong><a href="visualizarSolicitacoesEmAtendimentoPorEquipe.jsp?chv1=<c:out value="${rsetUsuario.rowsByIndex[0][2]}"/>">Por Equipe</a></strong></div></td>
          <td width="10%"><div align="center"><strong>Para Você</strong></div></td>
      </tr>
    </table>
   <br/>
   <table width="100%" border="1" bordercolor="#0000FF" id="solicitacoes">   
    <tr bgcolor="#00CCFF"> 
      <td width="8%"><div align="center"><strong>N&uacute;mero</strong></div></td>      
      <td width="8%"><div align="center"><strong>Data</strong></div></td>
      <td width="8%"><div align="center"><strong>Hora</strong></div></td>
      <td width="22%"><div align="center"><strong>Solicitante</strong></div></td>
      <td width="46%"><div align="center"><strong>Assunto</strong></div></td>
      <td width="8%"><div align="center"><strong></strong>%</div></td>   
      <td width="10%" colspan="6"><div align="center"><strong>Manuten&ccedil;&atilde;o</strong></div></td>
    </tr>
    <c:forEach var="row" items="${rsetReg.rowsByIndex}">
        <tr> 
            <td align="center"><div align="left"></div>${row[0]}</td>            
            <td><div align="left"></div>${row[2]}</td>
            <td><div align="left"></div>${row[3]}</td>
            <td><div align="left"></div>${row[1]}</td>
            <td><div align="left"></div>${row[7]}</td>
            <td align="center"><div align="left"></div>${row[8]}</td>            
            <td><div align="center"><a href="visualizarSolicitacao.jsp?chv1=${row[0]}"><img src="imagens/icones/visualizar.gif" alt="Visualizar a solicita&ccedil;&atilde;o" width="16" height="16" border="0" /></a></div></td>
            <td><div align="center"><img src="imagens/icones/delegar.gif" onclick="javascript:window.open('delegarSolicitacaoDeAtendimento.jsp?chv1=${row[0]}','teste','height=500,width=400,scrollbars=yes,status=yes,left = 300,top=100')" style="cursor:hand" width="16" height="16" border="0" /></a></div></td>
            <td><div align="center"><a href="editarSolicitacao.jsp?chv1=<c:out value="${row[0]}"/>"><img src="imagens/icones/editar.gif" width="16" height="16" border="0" /></a></div></td>
            <td><div align="center"><img src="imagens/icones/finalizar.gif" onclick="javascript:window.open('finalizarSolicitacaoDeAtendimento.jsp?chv1=${row[0]}','teste','height=500,width=400,scrollbars=yes,status=yes,left = 300,top=100')" style="cursor:hand" width="16" height="16" border="0" /></a></div></td>
            <td><div align="center"><img src="imagens/icones/arquivar.gif" onclick="javascript:window.open('arquivarSolicitacaoDeAtendimento.jsp?chv1=${row[0]}','teste','height=500,width=400,scrollbars=yes,status=yes,left = 300,top=100')" style="cursor:hand" width="16" height="16" border="0" /></a></div></td>
            <td><div align="center"><a href="visualizarHistoricoDoAtendimento.jsp?chv1=<c:out value="${row[0]}"/>"><img src="imagens/icones/historico.gif" width="16" height="16" border="0" /></a></div></td>
        </tr>
    </c:forEach>
  </table>
  <script language="javascript" type="text/javascript" >
      
      function janelaDelegar()
      {
      delegar = window.open('visualizarUsuariosDoSistema.jsp','teste',height=100,width=400,menubar=yes,toolbar=ye,location=yes,scrollbars=yes,status=yes,left = 300,top=100)
      }
      
  </script>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  </fieldset>
</form>

</body>
</html>
